#include<iostream>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	double sumA = 0, countA = 0;
	double sumB = 0, countB = 0;
	for (int i = 1; i <= n; i++)
	{
		if (i % k == 0)
		{
			sumA += i;
			countA++;
		}
		else
		{
			sumB += i;
			countB++;
		}
	}

	double resA = sumA / countA;
	double resB = sumB / countB;
	printf("%.1lf %.1lf", resA, resB);
	return 0;
}